home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group98a.txt
/
000105_icon-group-sender _Mon Mar 9 07:53:33 1998.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
3KB
Return-Path: <icon-group-sender>
Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id HAA20893
for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Mon, 9 Mar 1998 07:53:32 -0700 (MST)
Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
id AA11144; Mon, 9 Mar 1998 07:53:32 -0700
Message-Id: <3500B606.2C3A@gte.net>
Date: Fri, 06 Mar 1998 20:50:46 -0600
From: Mark Evans <evans@gte.net>
Reply-To: evans@gte.net
Organization: None
X-Mailer: Mozilla 3.01 (Win95; I)
Mime-Version: 1.0
To: icon-group@optima.CS.Arizona.EDU
Subject: Radio Buttons in VIB
References: <9803052117.AA07739@ cynic.org>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
Content-Length: 1917
Maybe someone can straighten me out about radio buttons in the VIB. I
have a four-element radio button "vidget" in VIB. All that I want to do
is assign numbers, 0,1,2,3,4 to each button. However my need for
descriptive text next to each number means I can't use the string
version of the number for the value. Furthermore, the number shown on
the screen is off-by-one from the actual button number. Button #1 has
value 0, button #2 has value 1, etc.
So it appears that I need a whole apparatus to handle this simple
object.
- a list of the string ID's in the vidget
(duplicating the VIB entry, very error prone if I
change the VIB entry)
- a table to lookup numbers by a string key (the text shown in the
vidget)
- two symmetrical conversion procedures
Seems like overkill to me -- someone help? It seems that what is needed
is a call that can return the *numerical* value of the vidget instead of
the *string* value. The vidget already knows the strings and their
relative positions. Is there a way just to get the number? Am I
missing something simple?
Here is what I'm doing.
_____________________________________________________________
global shannon_strings,shannon_table,shannon_order
# input = integer, 0-3
procedure shannon_get_str(order)
return shannon_strings[order+1]
end
# input = string, one of the shannon_strings
# the shannon_table is initialized inside init_world()
procedure shannon_get_order(str)
return (shannon_table[str] | 0)
end
procedure init_world()
local i
shannon_strings := ["0: Letters Same","1: Letters Different","2:
Digraph","3: Trigraph","4: Quadgraph"]
shannon_table := table("")
every i := 1 to *shannon_strings do
{
insert(shannon_table,shannon_strings[i],i-1)
}
shannon_order := 2
#default setting at startup
VSetState(vidgets["radio_button_ShannonOrder"],shannon_get_str(shannon_order))
end